/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrgs.inf.prav.interop.jsf.components;

import java.io.IOException;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;

/**
 *
 * @author Fernando
 */
public class SpanComponent extends PravBaseComponent {

    public static final String COMPONENT_FAMILY = "PRAV_SPAN";
    public static final String COMPONENT_TYPE = "PRAV_SPAN";

    public SpanComponent(){
        
    }

    @Override
    public void encodeBegin(FacesContext context) throws IOException {
        if (!displayPlataform()){
            hideInnerComponents();
            return;
        }

		ResponseWriter writer =
			context.getResponseWriter();
		writer.startElement("span", this);

        //atts
        addBaseAttributes(writer);

        String value = super.getValue();
        if (value != null)
            writer.write(super.getValue());
        writer.flush();
	}

    @Override
    public void encodeEnd(FacesContext context)
            throws IOException {
        if (!displayPlataform())
            return;
        ResponseWriter writer = context.getResponseWriter();
        writer.endElement("span");
        writer.flush();
//        return;
    }

    @Override
    public void decode(FacesContext context) {
    }

    // <editor-fold defaultstate="collapsed" desc="Getters and Setters">
    // </editor-fold>

}
